﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GameFramework.Fsm;

public abstract class GuessStateBase<T> : FsmState<T> where T :class
{

    protected IFsm<T> _fsm;

    protected override void OnInit(IFsm<T> fsm)
    {
        base.OnInit(fsm);
        _fsm = fsm;
    }

    protected override void OnDestroy(IFsm<T> fsm)
    {
        base.OnDestroy(fsm);
        _fsm = null;
    }

    protected override void OnEnter(IFsm<T> fsm)
    {
        base.OnEnter(fsm);
        InputManager.Ins.KeyDownEvent += OnKeyDown;
    }
    protected override void OnLeave(IFsm<T> fsm, bool isShutdown)
    {
        base.OnLeave(fsm, isShutdown);
        InputManager.Ins.KeyDownEvent -= OnKeyDown;
    }

    protected abstract void OnKeyDown(KeyCode obj);
 

}
